package com.pp.mariage.server;

import java.io.IOException;
import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 
 * @author Pascal
 *
 */
public class PaiementAdminServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		PersistenceManager pm = CadeauServlet.pmfInstance
				.getPersistenceManager();
		Query query = pm.newQuery(Paiement.class);
		List<Paiement> paiements = (List<Paiement>) query.execute();
		System.out.println(paiements);

		request.setAttribute("paiements", paiements);
		request.getRequestDispatcher("/restricted/paiement.jsp").forward(
				request, response);
	}
}
